﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../script/jquery.min.js"></script>
    <script src="../script/jquery.easyui.min.js"></script>
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <link href="../themes/Site.css" rel="stylesheet" />
   <script type="text/javascript">
       $(function (){      
           $('#dg').datagrid({
               fitColumns: true,
               pagination: true,
              // fit: true,
               singleSelect: true,
               rownumbers:true,
               url: '../Json/datagrid_data1.json',
               method: 'get',          
           columns: [[
               { field: 'productid', title: '店铺编号', width: 100 },
               { field: 'productname', title: '店铺名称', width: 100 },
               { field: 'itemid', title: '店铺类型', width: 100, align: 'right' },
           { field: 'attr1', title: '联系人', width: 100, align: 'right' },
       { field: 'unitcost', title: '联系电话', width: 100, align: 'right' },
           ]]
           });
           $("#add").click(function () {
              
                   $("#dig").dialog({ width: 400, height: 400 }).dialog("setTitle", "添加店铺").dialog("open");
                   $("#frm1").attr("src", "shopAdd.html");
              
           })

           $("#update").click(function () {
               var row = $("#dg").datagrid("getSelected");
               if (row!=null) {
                   $("#dig").dialog({ width: 400, height: 400 }).dialog("setTitle", "修改店铺").dialog("open");
                   $("#frm1").attr("src", "shopupdate.html");
               } else {
                   $.messager.alert("提示", "请选择要编辑的行", "warning");
               } 
           })
           $("#delete").click(function () {
               var row = $("#dg").datagrid("getSelected");
               if (row != null) {
                   $.messager.confirm('确认', '您确认想要删除选中的信息吗？', function (r) {
                       if (r) {
                           alert('确认删除');
                       }
                   });
               } else {
                   $.messager.alert("提示", "请选择要删除的行", "warning");
               }
           })
           $("#allot").click(function () {
               var row = $("#dg").datagrid("getSelected");
               if (row != null) {
                   $("#dig").dialog({ width: 400, height: 400 }).dialog("setTitle", "分配管理员").dialog("open");
                   $("#frm1").attr("src", "shopallot.html");
               } else {
                   $.messager.alert("提示", "请选择要编辑的行", "warning");
               }
           })
           
       })
   </script>
  
	<meta charset="utf-8" />
</head>
<body>
   
    <div id="tb" style="padding:5px;height:auto">

        <div style="margin-bottom:5px">
            <a id="add" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>
            <a id="update" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
            <a id="delete" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
            <a id="allot" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">分配管理员</a>
        </div>
        <div>
            店铺名称：<input id="Text1" type="text" />联系人：<input id="Text1" type="text" />店铺地址：<input id="Text1" type="text" />
            <a href="#" class="easyui-linkbutton Search" iconCls="icon-search">查询</a>
            
        </div>
        
        <table id="dg"></table>
          
    </div>
    <div id="dig">
        <iframe id="frm1" width="99%" height="99%"  frameborder="0" scrolling="no" ></iframe>
    </div>
</body>
</html>
